<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<!-- 在这个文件中编写 可以复用的HTML片段 -->
<!-- 可复用的导航栏 -->
<div class="fly-header layui-bg-black" th:fragment="header">
  <div class="layui-container">
    <a class="fly-logo" href="/">
      <img src="../res/images/logo.png" alt="layui">
    </a>
    <ul class="layui-nav fly-nav layui-hide-xs">
      <li class="layui-nav-item layui-this">
        <a href="/"><i class="iconfont icon-jiaoliu"></i>交流</a>
      </li>
      <li class="layui-nav-item">
        <a href="case/case.html"><i class="iconfont icon-iconmingxinganli"></i>案例</a>
      </li>
      <li class="layui-nav-item">
        <a href="http://www.layui.com/" target="_blank"><i class="iconfont icon-ui"></i>框架</a>
      </li>
    </ul>
    
    <ul class="layui-nav fly-nav-user"
    	th:if="${session.user == null}">
      
      <!-- 未登入的状态 -->
      <li class="layui-nav-item">
        <a class="iconfont icon-touxiang layui-hide-xs" href="user/login.html"></a>
      </li>
      <li class="layui-nav-item">
        <a th:href="@{/user/login}">登入</a>
      </li>
      <li class="layui-nav-item">
        <a th:href="@{/user/reg}">注册</a>
      </li>
      <li class="layui-nav-item layui-hide-xs">
        <a href="/app/qq/" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" title="QQ登入" class="iconfont icon-qq"></a>
      </li>
      <li class="layui-nav-item layui-hide-xs">
        <a href="/app/weibo/" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" title="微博登入" class="iconfont icon-weibo"></a>
      </li>
      
     </ul>
     <ul class="layui-nav fly-nav-user"
     	th:if="${session.user != null}">
     
      <!-- 登入后的状态 -->
      
      <li class="layui-nav-item">
        <a class="fly-nav-avatar" href="javascript:;">
          <cite class="layui-hide-xs" th:text="${session.user.nickname}">贤心</cite>
          <i class="layui-badge fly-badge-vip layui-hide-xs" 
          	th:if="${session.user.vip>0}"
          	th:text="'VIP'+${#strings.length(session.user.vip)}">VIP3</i>
          <img th:if="${session.user.head==null}" src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg">
          <img th:if="${session.user.head!=null}" th:src="@{/upload/}+${session.user.head}">
        </a>
        <dl class="layui-nav-child">
          <dd><a th:href="@{/user/set}"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
          <dd><a href="user/message.html"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd>
          <dd><a th:href="@{/user/home}"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
          <hr style="margin: 5px 0;">
          <dd><a th:href="@{/user/logout}" style="text-align: center;">退出</a></dd>
        </dl>
      </li>
      
    </ul>
  </div>
</div>



<div class="fly-panel fly-column" th:fragment="menu">
  <div class="layui-container">
    <ul class="layui-clear fly-menu">
      <li th:class="${param.type==null?'layui-hide-xs layui-this':'layui-hide-xs'}"><a href="/">首页</a></li> 
      <li th:class="${param.type+''=='1'?'layui-this':''}" type='1'><a th:href="@{/question/index(type=1)}" href="jie/index.html">提问</a></li> 
      <li th:class="${param.type+''=='2'?'layui-this':''}" type='2'><a th:href="@{/question/index(type=2)}" href="jie/index.html">分享<span class="layui-badge-dot"></span></a></li> 
      <li th:class="${param.type+''=='3'?'layui-this':''}" type='3'><a th:href="@{/question/index(type=3)}" href="jie/index.html">讨论</a></li> 
      <li th:class="${param.type+''=='4'?'layui-this':''}" type='4'><a th:href="@{/question/index(type=4)}" href="jie/index.html">建议</a></li> 
      <li th:class="${param.type+''=='5'?'layui-this':''}" type='5'><a th:href="@{/question/index(type=5)}" href="jie/index.html">公告</a></li> 
      <li th:class="${param.type+''=='6'?'layui-this':''}" type='6'><a th:href="@{/question/index(type=6)}" href="jie/index.html">动态</a></li> 
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li> 
      
      <!-- 用户登入后显示 -->
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block" 
      	th:if="${session.user != null}">
      	<a href="user/index.html">我发表的贴</a>
      </li> 
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"
      	th:if="${session.user != null}">
      	<a href="user/index.html#collection">我收藏的贴</a>
      </li> 
    </ul> 
    
    <div class="fly-column-right layui-hide-xs"> 
      <span class="fly-search"><i class="layui-icon"></i></span> 
      <a th:href="@{/question/add}" class="layui-btn">发表新帖</a> 
    </div> 
    <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;"> 
      <a th:href="@{/question/add}" class="layui-btn">发表新帖</a> 
    </div> 
  </div>
</div>


<ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user" th:fragment="user-set(choose)">
    <li class="layui-nav-item">
      <a th:href="@{/user/home}">
        <i class="layui-icon">&#xe609;</i>
        我的主页
      </a>
    </li>
    <li th:class="${choose==1?'layui-nav-item layui-this':'layui-nav-item'}">
      <a th:href="@{/user/index}">
        <i class="layui-icon">&#xe612;</i>
        用户中心
      </a>
    </li>
    <li th:class="${choose==2?'layui-nav-item layui-this':'layui-nav-item'}">
      <a th:href="@{/user/set}">
        <i class="layui-icon">&#xe620;</i>
        基本设置
      </a>
    </li>
    <li class="layui-nav-item">
      <a th:href="@{/user/message}">
        <i class="layui-icon">&#xe611;</i>
        我的消息
      </a>
    </li>
  </ul>
  

</body>
</html>